package com.agrm.model.address.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

@TableName("member_address")
@Getter
@Setter
public class Address implements Serializable {

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @TableField("member_id")
    private Integer memberId;

    @TableField("receiver")
    private String receiver;

    @TableField("phone")
    private String phone;

    @TableField("region_id")
    private Integer regionId;

    @TableField("region_detail")
    private String regionDetail;

    @TableField("is_default")
    private boolean isDefault;

    @TableField(exist = false)
    private ChinaRegions region;

    @Override
    public String toString() {
        return "Address{" +
                "id=" + id +
                ", memberId=" + memberId +
                ", receiver='" + receiver + '\'' +
                ", phone='" + phone + '\'' +
                ", regionId=" + regionId +
                ", regionDetail='" + regionDetail + '\'' +
                ", isDefault=" + isDefault +
                '}';
    }
}
